Namespace - LJCDBDataAccess
Returns
The result XML message.
Syntax
C# |
private DbResult Load()
|
Retrieves multiple data rows.
(E)
Remarks
This method is called from the
Execute()
method if the DbRequest.QueryType is "Load".
Example
C# |
private static Persons Load(DbDataAccess dbDataAccess
, DbColumns dataDefinition)
{
Person retValue = null;
List<string> columnNames = new List<string>();
foreach (DbColumn column in dataDefinition)
{
columnNames.Add(column.ColumnName);
}
var dataColumns = DbCommon.QueryColumns(columnNames, dataDefinition);
var keyColumns = new DbColumns()
{
{ "Name", (object)"TestName" }
};
dataDefinition.LJCSetExcludeKeyValue("PrincipleFlag");
var queryKeyColumns = DbCommon.QueryKeys(keyColumns, dataDefinition);
DbRequest dbRequest = new DbRequest()
{
Columns = dataColumns
QueryType = QueryType.Load.ToString(),
TableName = "PersonTest",
};
DbResult dbResult = dbDataAccess.Execute(dbRequest);
if (dbResult != null)
{
string sqlStatement = dbResult.ExecutedSql;
if (dbResult.DbRecords != null && dbResult.DbRecords.Count > 0)
{
retValue = new Persons();
foreach (DbValues dbValues in dbResult.DbRecords)
{
Person person = new Person();
DbCommon.SetObjectValues(dbValues, retValue);
retValue.Add(person);
}
}
}
return retValue;
}
|